const express = require('express')
const path = require('path')

const app = express()

// 静态资源托管
app.use(express.static(path.join(__dirname, './dist')))

// 处理页面 404 情况
app.use((req, res, next) => {
  res.sendFile(path.join(__dirname, './dist/index.html'))
})

app.listen(3000, () => console.log('http://localhost:3000/'))
